// SCSS variables are information about icon's compiled state, stored under its original file name
//
// .icon-home {
//   width: $icon-home-width;
// }
//
// The large array-like variables contain all information about a single icon
// $icon-home: x y offset_x offset_y width height total_width total_height image_path;
//
// At the bottom of this section, we provide information about the spritesheet itself
// $spritesheet: width height image $spritesheet-sprites;
$cft-pay-name: 'cftPay';
$cft-pay-x: 0px;
$cft-pay-y: 0px;
$cft-pay-offset-x: 0px;
$cft-pay-offset-y: 0px;
$cft-pay-width: 50px;
$cft-pay-height: 18px;
$cft-pay-total-width: 51px;
$cft-pay-total-height: 213px;
$cft-pay-image: 'sprite_pay.png';
$cft-pay: (0px, 0px, 0px, 0px, 50px, 18px, 51px, 213px, 'sprite_pay.png', 'cftPay', );
$pay1-name: 'pay1';
$pay1-x: 0px;
$pay1-y: 153px;
$pay1-offset-x: 0px;
$pay1-offset-y: -153px;
$pay1-width: 33px;
$pay1-height: 25px;
$pay1-total-width: 51px;
$pay1-total-height: 213px;
$pay1-image: 'sprite_pay.png';
$pay1: (0px, 153px, 0px, -153px, 33px, 25px, 51px, 213px, 'sprite_pay.png', 'pay1', );
$pay2-name: 'pay2';
$pay2-x: 0px;
$pay2-y: 188px;
$pay2-offset-x: 0px;
$pay2-offset-y: -188px;
$pay2-width: 48px;
$pay2-height: 25px;
$pay2-total-width: 51px;
$pay2-total-height: 213px;
$pay2-image: 'sprite_pay.png';
$pay2: (0px, 188px, 0px, -188px, 48px, 25px, 51px, 213px, 'sprite_pay.png', 'pay2', );
$sliver-name: 'sliver';
$sliver-x: 0px;
$sliver-y: 56px;
$sliver-offset-x: 0px;
$sliver-offset-y: -56px;
$sliver-width: 41px;
$sliver-height: 22px;
$sliver-total-width: 51px;
$sliver-total-height: 213px;
$sliver-image: 'sprite_pay.png';
$sliver: (0px, 56px, 0px, -56px, 41px, 22px, 51px, 213px, 'sprite_pay.png', 'sliver', );
$union-pay-name: 'unionPay';
$union-pay-x: 0px;
$union-pay-y: 88px;
$union-pay-offset-x: 0px;
$union-pay-offset-y: -88px;
$union-pay-width: 41px;
$union-pay-height: 22px;
$union-pay-total-width: 51px;
$union-pay-total-height: 213px;
$union-pay-image: 'sprite_pay.png';
$union-pay: (0px, 88px, 0px, -88px, 41px, 22px, 51px, 213px, 'sprite_pay.png', 'unionPay', );
$wx-pay-name: 'wxPay';
$wx-pay-x: 0px;
$wx-pay-y: 120px;
$wx-pay-offset-x: 0px;
$wx-pay-offset-y: -120px;
$wx-pay-width: 23px;
$wx-pay-height: 23px;
$wx-pay-total-width: 51px;
$wx-pay-total-height: 213px;
$wx-pay-image: 'sprite_pay.png';
$wx-pay: (0px, 120px, 0px, -120px, 23px, 23px, 51px, 213px, 'sprite_pay.png', 'wxPay', );
$zfb-pay-name: 'zfbPay';
$zfb-pay-x: 0px;
$zfb-pay-y: 28px;
$zfb-pay-offset-x: 0px;
$zfb-pay-offset-y: -28px;
$zfb-pay-width: 51px;
$zfb-pay-height: 18px;
$zfb-pay-total-width: 51px;
$zfb-pay-total-height: 213px;
$zfb-pay-image: 'sprite_pay.png';
$zfb-pay: (0px, 28px, 0px, -28px, 51px, 18px, 51px, 213px, 'sprite_pay.png', 'zfbPay', );
$spritesheet-width: 51px;
$spritesheet-height: 213px;
$spritesheet-image: 'sprite_pay.png';
$spritesheet-sprites: ($cft-pay, $pay1, $pay2, $sliver, $union-pay, $wx-pay, $zfb-pay, );
$spritesheet: (51px, 213px, 'sprite_pay.png', $spritesheet-sprites, );

// The provided mixins are intended to be used with the array-like variables
//
// .icon-home {
//   @include sprite-width($icon-home);
// }
//
// .icon-email {
//   @include sprite($icon-email);
// }
//
// Example usage in HTML:
//
// `display: block` sprite:
// <div class="icon-home"></div>
//
// To change `display` (e.g. `display: inline-block;`), we suggest using a common CSS class:
//
// // CSS
// .icon {
//   display: inline-block;
// }
//
// // HTML
// <i class="icon icon-home"></i>
@mixin sprite-width($sprite) {
  width: nth($sprite, 5);
}

@mixin sprite-height($sprite) {
  height: nth($sprite, 6);
}

@mixin sprite-position($sprite) {
  $sprite-offset-x: nth($sprite, 3);
  $sprite-offset-y: nth($sprite, 4);
  background-position: $sprite-offset-x  $sprite-offset-y;
}

@mixin sprite-image($sprite) {
  $sprite-image: nth($sprite, 9);
  background-image: url(#{$sprite-image});
}

@mixin sprite($sprite) {
  @include sprite-image($sprite);
  @include sprite-position($sprite);
  @include sprite-width($sprite);
  @include sprite-height($sprite);
}

// The `sprites` mixin generates identical output to the CSS template
//   but can be overridden inside of SCSS
//
// @include sprites($spritesheet-sprites);
@mixin sprites($sprites) {
  @each $sprite in $sprites {
    $sprite-name: nth($sprite, 10);
    .#{$sprite-name} {
      @include sprite($sprite);
    }
  }
}
